package in.muton.panels.paginator.components.badges;

import in.muton.edushare.components.images.ProfileImage;
import in.muton.edushare.pages.univ.UnivCourses;
import in.muton.edushare.pages.univ.UnivDept;
import in.muton.edushare.pages.univ.UnivPage;
import in.muton.edushare.pages.univ.UnivPeople;
import in.muton.edushare.url.EntityPageParams;

import org.apache.wicket.PageParameters;
import org.apache.wicket.markup.html.CSSPackageResource;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.link.BookmarkablePageLink;
import org.apache.wicket.markup.html.link.Link;
import org.apache.wicket.markup.html.panel.Panel;
import org.apache.wicket.model.IModel;

import com.edushare.common.constants.ApplicationConstants;
import com.edushare.common.vo.Universities;

public class UnivBadge extends Panel {

	public UnivBadge(String id, IModel<Universities> model) {
		super(id, model);
		add(CSSPackageResource.getHeaderContribution(UnivBadge.class,
				"badge.css"));
		PageParameters p = EntityPageParams.getParams(model);
		Link<Void> l = new BookmarkablePageLink<Void>("imgLink",
				UnivPage.class, p);
		add(l);
		l.add(new ProfileImage("img", model,
				ApplicationConstants.FILE_SUFFIX_ICON));
		l = new BookmarkablePageLink<Void>("nameLink", UnivPage.class, p);
		l.add(new Label("name", model.getObject().getUniversityName()));
		add(l);
		add(new BookmarkablePageLink<Void>("dept", UnivDept.class, p));
		add(new BookmarkablePageLink<Void>("course", UnivCourses.class, p));
		add(new BookmarkablePageLink<Void>("people", UnivPeople.class, p));
	}

	private static final long serialVersionUID = 530085506710079062L;
}
